import requests
from functools import partial
import subprocess

subprocess.Popen = partial(subprocess.Popen, encoding="utf-8")
import execjs

url = "https://vipapi.qimingpian.cn/search/recommendedItemList"

data = {
    "page": 1,
    "num": 20,
    "sys": "vip"
}
res = requests.post(url, data=data)
# res.encoding = 'utf8'
print(type(res))
res = res.json()['encrypt_data']
# res = res.json()

# print(res['encrypt_data'])
# res.json()

# with open("./js/parse_qimingpian.js", "r") as f:
#     content = f.read()
#     # 将文件内容编译成js代码
#     js_code = execjs.compile(content)
#     # 调用js函数
#     info = js_code.call("s", res)
#     print(info)

# for data in info["list"]:
#     print(data)
